package com.zhuiyun.pm.client.interest.service.impl;

import com.zhuiyun.pm.client.interest.entity.ClientInterest;
import com.zhuiyun.pm.client.interest.mapper.ClientInterestMapper;
import com.zhuiyun.pm.client.interest.service.ClientInterestService;
import com.zhuiyun.pm.config.CommonResult;
import com.zhuiyun.pm.page.MyPageHelper;
import com.zhuiyun.pm.page.PageRequest;
import com.zhuiyun.pm.page.PageResult;
import com.zhuiyun.pm.utils.Md5Util;
import com.zhuiyun.pm.utils.UploadFileUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;


@Service
public class ClientInterestServiceImpl implements ClientInterestService {
    //注入
    @Resource
    private ClientInterestMapper clientInterestMapper;

    /**
     * 被关注人详细信息
     * @author 温
     * @date 2023/3/23 14:36
     * @parameter [id]
     * @return com.zhuiyun.pm.client.interest.entity.ClientInterest
     */
    @Override
    public ClientInterest clientInterestList( int userId, int uuId) {
        ClientInterest clientInterest = clientInterestMapper.clientInterestList(userId, uuId);
        return clientInterest;
    }

    /**
     * 关注一个用户
     * @author 温
     * @date 2023/3/23 14:36
     * @parameter [clientInterest]
     * @return int
     */
    @Override
    public int clientInterestAdd(ClientInterest clientInterest) {
        clientInterest.setDelFlag(0);
        int i = clientInterestMapper.clientInterestAdd(clientInterest);
        return i;
    }

    /**
     * 取消关注
     * @author 温
     * @date 2023/3/23 14:35
     * @parameter [id]
     * @return int
     */
    @Override
    public int clientInterestDel( int userId,  int uuId) {
        int i = clientInterestMapper.clientInterestDel(userId,uuId);
        return i;
    }

    /**
     * 查询粉丝数量
     * @author 温
     * @date 2023/3/23 19:21
     * @parameter [userId]
     * @return java.lang.Integer
     */
    @Override
    public Integer clientInterest(int uuId) {
        Integer sum= clientInterestMapper.clientInterest(uuId);
        return sum;
    }

}